package main

import (
	"bytes"
	"encoding/json"
	"log"
	"os"
)

func main() {

	b, err := json.Marshal(&person{
		Name: "marshal",
		Age:  100,
	})
	if err != nil {
		log.Fatal(err)
	}
	var out bytes.Buffer

	out.Write(b)
	//{"name":"marshal","age":100}
	out.WriteTo(os.Stdout)
}

type person struct {
	Name    string  `json:"name"`
	Address Address `json:"-"`
	Age     int     `json:"age"`
}

type Address struct {
	Province string
	City     string
	Street   string
	Code     int64
}
